package com.blog.cloud.oss.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSBuilder;
import com.aliyun.oss.OSSClientBuilder;
import com.blog.cloud.oss.properties.AliyunOssProperties;
import org.springframework.context.annotation.Bean;

public class OssConfig {

    @Bean
    public OSS ossClient(AliyunOssProperties properties) {
        OSSBuilder builder = new OSSClientBuilder();
        return builder.build(properties.getEndpoint(), properties.getAccessId(), properties.getSecretKey());
    }

}
